﻿@model Admin.ViewModels.User.RegisterViewModel
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>注册 | 管理系统</title>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="icon" href="~/favicon.ico" type="image/x-icon">
    <link href="https://fonts.proxy.ustclug.org/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">
    <link href="https://fonts.proxy.ustclug.org/icon?family=Material+Icons" rel="stylesheet" type="text/css">

    <link href="~/plugins/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="~/plugins/waves/waves.css" rel="stylesheet" />
    <link href="~/plugins/animate/animate.css" rel="stylesheet" />
    <link href="~/plugins/abp/styles/abp.css" rel="stylesheet" />
    <link href="~/plugins/toastr/toastr.css" rel="stylesheet" />
    <link href="~/css/themes/all-themes.css" rel="stylesheet" />
    <link href="~/css/style.css" rel="stylesheet">
</head>

<body class="signup-page">
    <div class="signup-box">
        <div class="card">
            <div class="body">
                <form id="register" method="POST">
                    <div class="msg">用户注册</div>
                    <div class="input-group">
                        <span class="input-group-addon">
                            <i class="material-icons">person</i>
                        </span>
                        <div class="form-line">
                            <input type="text" class="form-control" asp-for="Name" placeholder="名称" required autofocus>
                        </div>
                    </div>
                    <div class="input-group">
                        <span class="input-group-addon">
                            <i class="material-icons">lock</i>
                        </span>
                        <div class="form-line">
                            <input type="password" class="form-control" asp-for="Password" placeholder="密码" required>
                        </div>
                    </div>
                    <div class="input-group">
                        <span class="input-group-addon">
                            <i class="material-icons">lock</i>
                        </span>
                        <div class="form-line">
                            <input type="password" class="form-control" id="confirm" name="confirm" placeholder="确认密码" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <input type="checkbox" name="terms" id="terms" class="filled-in chk-col-pink">
                        <label for="terms">我已经阅读并同意 <a href="javascript:void(0);">使用条款</a>.</label>
                    </div>

                    <button class="btn btn-block btn-lg bg-pink waves-effect" type="submit">注册</button>

                    <div class="m-t-25 m-b--5 align-center">
                        <a asp-action="Login">已有账号?</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script src="~/plugins/jquery/jquery.min.js"></script>
    <script src="~/plugins/bootstrap/js/bootstrap.js"></script>
    <script src="~/plugins/bootstrap-select/js/bootstrap-select.js"></script>
    <script src="~/plugins/jquery-slimscroll/jquery.slimscroll.js"></script>
    <script src="~/plugins/waves/waves.js"></script>
    <script src="~/plugins/sweetalert/sweetalert.min.js"></script>
    <script src="~/plugins/toastr/toastr.min.js"></script>
    <script src="~/plugins/blockUI/jquery.blockUI.js"></script>
    <script src="~/plugins/spin/spin.js"></script>
    <script src="~/plugins/spin/jquery.spin.js"></script>
    <script src="~/plugins/jquery-validation/jquery.validate.js"></script>
    <script src="~/plugins/jquery-validation/localization/messages_zh.js"></script>
    <script src="~/plugins/abp/scripts/abp.js"></script>
    <script src="~/plugins/abp/scripts/libs/abp.jquery.js"></script>
    <script src="~/plugins/abp/scripts/libs/abp.sweetalert.js"></script>
    <script src="~/plugins/abp/scripts/libs/abp.toastr.js"></script>
    <script src="~/plugins/abp/scripts/libs/abp.blockUI.js"></script>
    <script src="~/plugins/abp/scripts/libs/abp.spin.js"></script>

    <script>
        $(function () {
            var $form = $('#register');
            $form.validate({
                rules: {
                    'terms': {
                        required: true
                    },
                    'confirm': {
                        equalTo: '[name="@Html.IdFor(x=>x.Password)"]'
                    }
                },
                highlight: function (input) {
                    $(input).parents('.form-line').addClass('error');
                },
                unhighlight: function (input) {
                    $(input).parents('.form-line').removeClass('error');
                },
                errorPlacement: function (error, element) {
                    $(element).parents('.input-group').append(error);
                    $(element).parents('.form-group').append(error);
                }
            });

            $form.submit(function (e) {
                e.preventDefault();
                if (!$form.valid()) {
                    return;
                }

                abp.ui.setBusy(
                    document.body,

                    abp.ajax({
                        contentType: 'application/x-www-form-urlencoded',
                        url: $form.attr('action'),
                        data: $form.serialize()
                    })
                );
            });
        });
    </script>
</body>

</html>